package cn.itcast.dmp.report

import cn.itcast.dmp.config.AppConfigHelper
import cn.itcast.dmp.process.ReportProcessor
import org.apache.spark.sql.{DataFrame, SparkSession}

object ReportAdsNetworkProcessor extends ReportProcessor{
  override def targetTableName: String = {
    AppConfigHelper.REPORT_ADS_NETWORK_TABLE_NAME
  }

  override def targetTableKeys: Seq[String] = {
    Seq("report_date","networkmannerid", "networkmannername")
  }

  override def realProcessData(odsDF: DataFrame): DataFrame = {
    val spark: SparkSession = odsDF.sparkSession
    odsDF.createTempView("networktable")
    val dataFrame: DataFrame = spark.sql(ReportSQLConstant.reportAdsKpiWithSQL("networktable",Seq("networkmannerid","networkmannername")))
    dataFrame
  }
}
